(1) Field of the Invention
The present invention relates to a method of and apparatus for extracting contour data of a particular image area in an original image such as a photographic image, which is used in preparing a "silhouette mask" in a photo process.
(2) Description of the Related Art
In printing a commodity pamphlet or the like, a photograph of a commodity used as an original usually includes the background as well as the commodity. It often is the case that a finished print shows only a commodity image after eliminating the background. The silhouette mask is used for such a purpose, and is prepared through electronic image processing as set out hereunder.
First, vector data or binary data of a contour line of a particular image area in an original are prepared. Then, silhouette mask pattern data are prepared by assigning "1" to one of the areas inside and outside the contour line and "0" to the other. On the basis of the silhouette mask pattern data, the particular image area alone is extracted from the original for reproduction.
In preparing silhouette mask pattern data as noted above, contour data of a particular image area in an original are obtained by a method as disclosed in UK Patent GB 2 121 534B or U.S. Pat. No. 4,868,884. These conventional methods will be described hereinafter with reference to FIG. 1.
In FIG. 1, area A is a particular image area to be extracted, and area B a background area. A partial image section N1 represented in a frame is set to a selected location including part of a contour line l which is a border in density variation of the image area A. Density levels of pixels within this image section N1 are compared with a predetermined threshold level to binarize image data of the image section N1. Coordinates of the borderline are obtained by tracing the border of the binary image. The coordinates of the borderline constitute contour data of a partial image in the image section N1.
Once the contour data of the partial image section N1 are obtained, the operator moves the partial image section slightly along the contour line l of the image area A and sets a new partial image section N2. Contour data of a partial image in the image section N2 are obtained through the same process as described above.
This process is carried out successively for partial image sections N1, N2, N3 and so on which are set along the contour line l of the particular image area A, thereby to obtain contour data of the contour line l of the image area A.
The manner of setting the threshold level is different between the methods described in UK Patent GB 2 121 534B and U.S. Pat. No. 4,868,884. In the former, an average density value of each partial image section is automatically set as a threshold level. According to this method, however, a difference may occur in threshold level between adjacent image sections when extracting a natural image, for example, which involves gradually varying average density levels. This results in an inconvenience, as shown in FIG. 2, of extracting broken contour lines Li and Li+1 from adjacent partial image sections Ni and Ni+1.
In the latter method, the operator may freely select a threshold level by manipulating an encoder (which is called a shaft in the published application). According to this method, the operator, while watching extracted contour lines in the respective partial image sections appearing on a screen, selects threshold levels to obtain a continuous contour line running through adjacent partial image sections. Thus, this method presents a prima facie solution to the problem mentioned above.
It is to be noted that, in this specification, the term "contour line" refers to the contour of the particular image area A which is recognized as a border in density variations of an image in an original, while the term "extracted contour line" refers to a line based on contour data of the particular image area A and extracted through image processing. The two lines are differentiated herein.
The latter method described above also has a disadvantage.
That is, the extracted contour line may be broken in the following case. Assume a case as shown in FIG. 3A, for example, where a contour line l of particular image areas A1 and A2 having a wide difference in density level is to be extracted in a direction shown in a dot-and-dash line. It is also assumed that the particular image areas A1 and A2 and a background area B have density variations transversely of the contour line l, i.e. in the direction of its width w in FIG. 3A. As depicted in enlargement in FIG. 3B, a new partial image section Ni is set following an image section Ni-1. A threshold level is set so that an extracted contour line Li' in the current image section Ni continue from an extracted contour line Li-1 in the preceding image section Ni-1. Then, the contour line may not be extracted for the image area A2 though extracted for the image area A1. If a threshold level is set for extracting the contour line of the image area A2, an extracted contour line Li' will be staggered from the extracted contour line Li-1 in the previous image section Ni-1 as shown in FIG. 3C. This inconvenience may be avoided by reducing the size and amount of movement of the partial image section, and adjusting the threshold level with nicety. However, such an operation is irksome and inefficient.
As described above, the technical problem of obtaining a continuous extracted contour line is by and large solved by allowing a threshold level to be set for each partial image section. However, there remains a drawback that the extracted contour line is broken when use is made of partial image sections having a normal size suited for operation.
When an extracted contour line is broken, a data correcting process is carried out as described in the UK Patent GB 2 121 534B. That is, after collecting all contour data, a straight line is drawn to interconnect detected coordinate points defining the shortest distance between extracted, broken contour lines. Alternatively, a manual correction is effected in which the operator monitors extracted contour lines appearing on a screen and interconnects the lines at positions of discontinuity.
According to the correction based on the simple data processing noted above, the extracted contour line becomes jagged and unsightly. The manual correction has the disadvantage of requiring time and trouble and lowering operating efficiency.